class Gun:
    def __init__(self, mode1):
        # 枪支型号
        self.mode1 = mode1
        # 子弹数量
        self.bullet_count = 0

    def add_bullet(self,count):
        self.bullet_count += count

    def shoot(self):
        if self.bullet_count <= 0:
            print("empty fire")
            return
        self.bullet_count -= 1

        print("%s fire[%d]" % (self.mode1, self.bullet_count))


# 创建枪对象
ak47 = Gun("ak47")
ak47.add_bullet(1)
ak47.shoot()









